# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-luhn
_pkgname=luhn
pkgver=0.2.0.r1.gc26e5c6
pkgrel=6
pkgdesc='Generate and verify Luhn check digits.'
arch=('any')
url='https://github.com/mmcloughlin/luhn'
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/mmcloughlin/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname

  python setup.py build
}

package() {
  cd $_pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

